/*! \file clist.h
    \brief Custom list implementation for C (used by OBJ parser), acquired from http://www.kixor.net/dev/objloader/ (public domain).

	Head X | Flinders University | Martin Luerssen | 2009+
*/

#pragma once

typedef struct
{
	int item_count;
	int current_max_size;
	char growable;

	void **items;
	char **names;	
} clist;

void clist_make(clist *clisto, int size, char growable);
int clist_add_item(clist *clisto, void *item, char *name);
char* clist_print_items(clist *clisto);
void* clist_get_name(clist *clisto, char *name);
void* clist_get_index(clist *clisto, int indx);
void* clist_get_item(clist *clisto, void *item_to_find);
int clist_find(clist *clisto, char *name_to_find);
void clist_delete_index(clist *clisto, int indx);
void clist_delete_name(clist *clisto, char *name);
void clist_delete_item(clist *clisto, void *item);
void clist_delete_all(clist *clisto);
void clist_print_list(clist *clisto);
void clist_free(clist *clisto);

void test_clist();

